package org.jader.bolao;

import java.util.Date;
import java.util.Iterator;
import java.util.List;

import org.jader.bolao.beans.PropertyChangeListener;

public interface Game extends Comparable<Game> {

	public enum Type {
		ALL_PLAY,
		ONE_VS_ONE,
		INDIVIDUAL,
		;
		
		@Override
		public String toString() {
			switch(this) {
			case ALL_PLAY:
				return "Caminhada";
			case ONE_VS_ONE:
				return "1 contra 1";
			case INDIVIDUAL:
				return "Individual";
			}
			return null;
		}
	}
	
	public Championship championship();

	public String getPlace();
	
	public Date getDate();
	
	public boolean containsTeam(Object arg0);

	public Iterator<Team> teamsIterator();

	/* Commented to enable GameIndividual
	public Team getTeam(int arg0);

	public int indexOfTeam(Object arg0);

	public boolean hasNoTeams();

	public Iterator<Team> teamsIterator();

	public int numberOfTeams();
	*/

	public boolean addPlayer(Player p);

	public boolean containsPlayer(Object arg0);
	
	public GamePlayer getPlayer(Player arg0);

	public boolean hasNoPlayer();

	public Iterator<GamePlayer> playerIterator();

	public int numberOfPlayers();

	public void swapPlayers(GamePlayer p1, GamePlayer p2);

	public boolean removePlayer(GamePlayer p);
	
	public List<GamePlayer> subListOfPlayers(Team arg0);

	/* Commented to enable GameIndividual
	public int getTotalSum (Team t);

	public boolean isWinner(Team team);
	*/

	@Override
	public int compareTo(Game g);
	
	public void firePropertyChange(Object o, String param);

	public void addPropertyChangeListener(PropertyChangeListener pcl);

	public void refreshPropertyChangeListeners();

	public void setPlace(String text);

	public void setDate(Date newDate);
}
